package nl.ru.rd.facedetection.nnbfd.neuralnetwork;

import java.io.Serializable;

/**
 * A Layer in a Neural Network.
 * 
 * @author Wouter Geraedts (s0814857)
 */
public interface Layer extends Serializable
{
	/**
	 * Bind this Layer to the next Layer in a Network hierarchy.
	 * 
	 * @param layer
	 *            The next Layer in a Network hierarchy.
	 */
	public void bind(Layer layer);

	/**
	 * Get the the next Layer in a Network hierarchy.
	 * 
	 * @return The next Layer in a Network hierarchy.
	 */
	public Layer getNextLayer();

	/**
	 * Get the number of nodes in this Layer.
	 * 
	 * @return The number of nodes in this Layer.
	 */
	public int getSize();

	/**
	 * Get the Activation value for a specific Node in the Layer.
	 * 
	 * @param i
	 *            The index-number of the Node from which the Activation value should be fetched.
	 * @return The Activation value of the selected Node. Activation value equals the result of the activationfunction of the sum of the weights times
	 *         activations of the connected synapses of the specific Node.
	 */
	public abstract double getActivation(int i);

	/**
	 * Update the activation values of the Nodes of this Layer.
	 */
	public abstract void update();
}
